package com.cgx.service;

import com.cgx.entity.message.Session;
import com.cgx.entity.message.SessionUser;
import com.cgx.vo.websocket.MessageVo;
import com.cgx.vo.ResultVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

@FeignClient("live-chat-web-message")
public interface MessageService {

    @GetMapping(value = "/live-chat/message/sendMessageToUser", consumes = MediaType.APPLICATION_JSON_VALUE)
    Map<String, ResultVo> sendMessageToUser(@RequestBody MessageVo messageVo);

    @GetMapping(value = "/live-chat/session/sendMessageBySessionId", consumes = MediaType.APPLICATION_JSON_VALUE)
    Map<String, ResultVo> sendMessageBySessionId(@RequestBody MessageVo messageVo);

    @GetMapping(value = "/live-chat/session/getSessionBySessionId", consumes = MediaType.APPLICATION_JSON_VALUE)
    List<Session> getSessionBySessionId(@RequestBody List<String> idList);

    @GetMapping(value = "/live-chat/session/getSessionUserBySessionId", consumes = MediaType.APPLICATION_JSON_VALUE)
    List<SessionUser> getSessionUserBySessionId(@RequestBody List<String> idList);

    @GetMapping(value = "/live-chat/message/saveMessage", consumes = MediaType.APPLICATION_JSON_VALUE)
    Map<String, ResultVo> saveMessage(@RequestBody List<MessageVo> messageList);
}
